<?php
require_once("../../controllers/init.php");
//echo "Filesystem root = ".$FILE_SYSTEM_ROOT."\n<br>";
require_once($FILE_SYSTEM_ROOT."/controllers/authentication.php");
//echo "logged on - ".(($IS_LOGGED_ON)?"true\n":"false\n");
require_once($FILE_SYSTEM_ROOT."/model/classes/events/BookingForm.php");

$EventID = $_POST['EventID'];
$bookingForm = new BookingForm($EventID);
$isBookingForm=($bookingForm->getBookingFormID()=='')?false:true;

if(!$isBookingForm)
{
	$bookingForm->init();
}

$tabTitle1 = "General";
$tabTitle2 = "Vergers";
$tabTitle3 = "Music";
$tabTitle4 = "Finance";
$tabTitle5 = "Catering";
$tabTitle6 = "Publicity";
$tabTitle7 = "Timetable";
$tabTitle8 = "Safeguarding";
$tabTitle9 = "Liturgy";

$tabContent1 = $bookingForm->getGeneralHTML();
$tabContent2 = $bookingForm->getVergersHTML();
$tabContent3 = $bookingForm->getMusicHTML();
$tabContent4 = $bookingForm->getFinanceHTML();
$tabContent5 = $bookingForm->getCateringHTML();
$tabContent6 = $bookingForm->getPublicityHTML();
$tabContent7 = $bookingForm->getTimetableHTML();
$tabContent8 = $bookingForm->getSafeguardingHTML();
$tabContent9 = $bookingForm->getLiturgyHTML();
		

?>


<div id="calendar-month-event-edit-booking-edit-tabs">
	<ul>
	<li><a href="#tabs-1"><?php echo $tabTitle1;?></a></li>
	<li><a href="#tabs-2"><?php echo $tabTitle2;?></a></li>
	<li><a href="#tabs-3"><?php echo $tabTitle3;?></a></li>
	<li><a href="#tabs-4"><?php echo $tabTitle4;?></a></li>
	<li><a href="#tabs-5"><?php echo $tabTitle5;?></a></li>
	<li><a href="#tabs-6"><?php echo $tabTitle6;?></a></li>
	<li><a href="#tabs-7"><?php echo $tabTitle7;?></a></li>
	<li><a href="#tabs-8"><?php echo $tabTitle8;?></a></li>
	<li><a href="#tabs-9"><?php echo $tabTitle9;?></a></li>
	</ul>
	<div id="tabs-1">
		<div data-content_id="<?php echo $EventID;?>-1" id="edit-tabs-1" class="edit-tab"><?php echo $tabContent1;?></div>
<!--		<button class = "edit-tab-button ui-button ui-widget" id = "edit-tabs-1">Edit</button> -->
	</div>
	<div id="tabs-2">
		<div data-content_id="<?php echo $EventID;?>-2" id="edit-tabs-2" class="edit-tab"><?php echo $tabContent2;?></div>
<!--		<button class = "edit-tab-button ui-button" id = "edit-tabs-2">Edit</button> -->
	</div>
	<div id="tabs-3">
		<div data-content_id="<?php echo $EventID;?>-3" id="edit-tabs-3" class="edit-tab"><?php echo $tabContent3;?></div>
<!--		<button class = "edit-tab-button ui-button" id = "edit-tabs-3">Edit</button> -->
	</div>
	<div id="tabs-4">
		<div data-content_id="<?php echo $EventID;?>-4" id="edit-tabs-4" class="edit-tab"><?php echo $tabContent4;?></div>
<!--		<button class = "edit-tab-button ui-button" id = "edit-tabs-4">Edit</button> -->
	</div>
	<div id="tabs-5">
		<div data-content_id="<?php echo $EventID;?>-5" id="edit-tabs-5" class="edit-tab"><?php echo $tabContent5;?></div>
<!--		<button class = "edit-tab-button ui-button" id = "edit-tabs-5">Edit</button> -->
	</div>
	<div id="tabs-6">
		<div data-content_id="<?php echo $EventID;?>-6" id="edit-tabs-6" class="edit-tab"><?php echo $tabContent6;?></div>
<!--		<button class = "edit-tab-button ui-button" id = "edit-tabs-6">Edit</button> -->
	</div>
	<div id="tabs-7">
		<div data-content_id="<?php echo $EventID;?>-7" id="edit-tabs-7" class="edit-tab"><?php echo $tabContent7;?></div>
<!--		<button class = "edit-tab-button ui-button" id = "edit-tabs-7">Edit</button> -->
	</div>
	<div id="tabs-8">
		<div data-content_id="<?php echo $EventID;?>-8" id="edit-tabs-8" class="edit-tab"><?php echo $tabContent8;?></div>
<!--		<button class = "edit-tab-button ui-button" id = "edit-tabs-8">Edit</button> -->
	</div>
	<div id="tabs-9">
		<div data-content_id="<?php echo $EventID;?>-9" id="edit-tabs-9" class="edit-tab"><?php echo $tabContent9;?></div>
<!--		<button class = "edit-tab-button ui-button" id = "edit-tabs-9">Edit</button> -->
	</div>
</div>

